/**
 * Created by Dalyn on 2017/3/28.
 */
import Relay from "react-relay";

export default class UpdateProductMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { updateGoods }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageNum: this.props.pageNum,
                ids: this.props.ids,
                goodsId: this.props.goodsId,
                categoryId: this.props.categoryId,
                companyId: this.props.companyId,
                status: this.props.status,

                productName:this.props.productName,
                styleNo:this.props.styleNo,
                constituent:this.props.constituent,
                specification:this.props.specification,
                gramWeight:this.props.gramWeight,
                larghezza:this.props.larghezza,
                description:this.props.description,
                ranzhengProcess:this.props.ranzhengProcess,
                yarn:this.props.yarn,
                fabricWeave:this.props.fabricWeave,
                density:this.props.density,
                season:this.props.season,
                purpose:this.props.purpose,
                carding:this.props.carding,
                networkType:this.props.networkType,
                thickness:this.props.thickness,
                weftYarn:this.props.weftYarn,
                high:this.props.high,
                weavingProcess:this.props.weavingProcess,
                colour:this.props.colour,
                size:this.props.size,
                prickle:this.props.prickle,
                yarnTypes:this.props.yarnTypes,
                yarnState:this.props.yarnState,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on updateGoodsPayload {
            responseData {  
                errorCode
                value
                totalResult
                id
                goodsProperty
                companyList
                goodsInfoDescModel{
                    goodsId
                }
                goodsInfoDescModelList{
                   
                    goodsId
                    
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on updateGoodsPayload {
                    responseData {
                        errorCode
                        value
                        totalResult
                        id
                        goodsProperty
                        companyList
                        goodsInfoDescModel{
                            goodsId
                        }
                        goodsInfoDescModelList{
                            goodsId   
                        }
                                                
                    }
                }
            `]
        }];
    }

}